import { createStore, applyMiddleware } from "redux"
import logger from "redux-logger"
import { persistStore, persistReducer } from 'redux-persist'
import storage from "redux-persist/lib/storage"
import reducer from "./reducer"

var persistedReducer = persistReducer({ key: 'redux', storage }, reducer)
export var store = createStore(persistedReducer, applyMiddleware(logger))
export var persistor = persistStore(store)

export default createStore(reducer, applyMiddleware(logger))